define(["jquery"],function($){
	var quest = {};

	/**
	 * tpl模板
	 */
	quest.tpl = function(){
		return 	'<script id="tpl_question_staticTextarea" type="text/html">'+
				'	<div {{if relationId}}relationId="{{relationId}}"{{/if}} class="qaCard form-group form-group-sm col-sm-{{length}} col-md-{{length}} grid-label-{{labelLength}}">'+
				'		<label class="control-label {{align}}">{{label}}</label>'+
				'   	<div class="control-input">'+
				'			<p class="form-control-static form-control-static-textarea validatebox" name="{{id}}" data-val="{{val}}" data-type="{{type}}" data-validate="{{validate}}" data-attention="{{attention}}"></p>'+
				'  		</div>'+
				'	</div>'+
				'</script>';
	}

	/**
	 * 处理默认的val、保存的value
	 */
	var handleVal = function($dom,value){
		if( value || value == "" ){
			$dom.html(value);
		}
	}

	/**
	 * 赋默认值
	 */
	quest.setDefaultVal = function($dom){
		var val = $dom.attr("data-val");
		handleVal($dom,val);
	}

	/**
	 * 赋值
	 */
	quest.setValue = function($dom,value){
		handleVal($dom,value);
	}

	return quest;
});